<template>
  <div>
    <date-range-picker v-model="dateRange" title="日期:" />
    <div v-if="dateRange.length">
      <p>开始日期: {{ formatDate(dateRange[0]) }}</p>
      <p>结束日期: {{ formatDate(dateRange[1]) }}</p>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import DateRangePicker from './components/yc-search-datePicker.vue'; // 确保路径正确  

const dateRange = ref([]);

const formatDate = (date) => {
  if (!date) return '';
  return new Date(date).toLocaleString('zh-CN', {
    year: 'numeric',
    month: '2-digit',
    day: '2-digit',
    hour: '2-digit',
    minute: '2-digit',
    second: '2-digit',
    timeZoneName: 'short',
  });
};
</script>

<style>
/* 你可以在这里添加样式 */
</style>